import mockRequests from "./mockRequest";
import requests from "./Request";
import userRequests from "./userRequest";
// 获取轮播图图片
export const reqGetBannerList = () => mockRequests.get('/banner')
// 获取搜索结果图片
// export const reqGetSearchResult = () => mockRequests.get('/search')
// 获取用户所发布的商品的数据
// export const reqGetUserPublicList = () => mockRequests.get('/mypublic')
// 获取用户购买的商品的数据
// export const reqGetUserBuyList = () => mockRequests.get('/mypublic')

// 获取登陆数据
export const reqUserLogin = (account) => requests.post(`/user/login`, account)
// 获取注册数据
export const reqUserRegister = (account) => requests.post(`/user/register`, account)
// 获取用户信息
export const reqGetUserInfo = () => requests.get("/user/getUser")
// 用户请求修改账号安全信息
export const reqUserModify = (newAccount) => requests.post('/user/modifyUser', newAccount)
// 用户修改账号信息
export const reqEditUserInfo = (account) => requests.post("/user/modifyUserIntroduce", account)


// 用户进行商品搜索
export const reqGetSearchList = (params) => requests.post(`/good/query`, params)
// 获取商品的详情数据
export const reqGetGoodInfo = (goodId) => requests.get(`/good/getGoodsById?goodId=${goodId}`)
// 将商品添加到购物车
export const reqAddShopCart = ({ goodId, goodsNum }) => requests.get(`/shopCart/addShopCart?goodId=${goodId}&goodsNum=${goodsNum}`)
// 获取购物车数据
export const reqGetShopCart = (params) => requests.post("/shopCart/getShopCart", params)
// 修改购物车条目的选中状态
export const reqUpdateChecked = ({ goodId, checked }) => requests.get(`/shopCart/modifyChecked?goodId=${goodId}&checked=${checked}`)
// 修改购物车中商品的数量
export const reqEditShopCartNums = ({ goodId, editNums }) => requests.get(`/shopCart/modifyNumber?goodId=${goodId}&editNums=${editNums}`)
// 删除购物车商品
export const reqDeleteShopCartGood = (goodId) => requests.get(`/shopCart/deleteGood?goodId=${goodId}`)
// 请求生成订单并获取信息
export const reqGetOrder = () => requests.get("/goodOrder/getOrder")
// 完成订单交易
export const reqPayOrder = (orderId)=>requests.get(`/goodOrder/payOrder?orderId=${orderId}`)


// 用户获取自己的订单
export const reqUserOrderList = (params)=>requests.post("/goodOrder/getGoodOrderByGoodName",params)
// 用户发布自己的商品
export const reqPublicGoods = (params)=>requests.post("/user/publish",params)
// 获取商品类别列表
export const reqSelectList = ()=>requests.get("/admin/goodType/select")
// 用户获取自己发布的商品
export const reqGetUserPublicList = (params)=>requests.post("/user/getUserGoods",params)
// 用户修改自己的商品的信息
export const reqEditUserPublicGoodsInfo = (params)=>requests.post("/user/modifyUserGoods",params)
// 用户下架自己的商品
export const reqDeleteUserPublicGoods = (goodId)=>requests.get(`/user/deListing/${goodId}`)
